<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style>
			.a{
				width: 50px;
				height: 100px;
				background-color: red;
			}
			
			.b{
				width: 100px;
				height: 150px;
				background-color: aqua;
			}
		</style>
	</head>
	<body>
		<button onclick="change()">改变</button>
		<div class="a"></div>
		
		<script>
			let a = document.querySelector('.a');
			
			let con = 1;
			function change(){
				if(con % 2 != 0)
				{
					a.className = 'b';
				}
				else
				{
					a.className = 'a';
				}
				
				con = con + 1;
			}
		</script>
	</body>
</html>